package com.pilot.game.repository;

import com.pilot.game.domain.Customer;
import org.springframework.stereotype.Repository;

import org.springframework.data.jpa.repository.*;

import java.util.List;


/**
 * Spring Data JPA repository for the Customer entity.
 */
@SuppressWarnings("unused")
@Repository
public interface CustomerRepository extends JpaRepository<Customer, Long> {

    Customer findByAccountNameAndPassword(String accountName, String password);

    List<Customer> findByAccountName(String accountName);

    Customer findByMobile(String mobile);

    @Query("select count(u.id) from Customer u where u.agency = ?1")
    int findCountByAgency(String agency);
}
